import React from 'react'
import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'
import loadable from "./loadable"
import User from './pages/user/user'//用户界面
import Nav from './publicComponents/nav/nav'

const aboutUs = loadable(() => import('./Tyj/views/AboutUs.jsx'))
const navigation = loadable(() => import('./Tyj/views/Navigation.jsx'))
const detail = loadable(() => import('./Tyj/views/Detail.jsx'))

const Info = loadable(() => import('./pages/info/info.jsx'))
const InfoDetail = loadable(() => import("./pages/info/components/InfoDetail.jsx"))

const Collections = loadable(() => import('./zhuanti/collections'))//专题


const CollectionsDetail = loadable(() => import('./zhuanti/collectionsdetail'))//专题详情页
const CollectionsInfo = loadable(() => import('./zhuanti/collectionsinfo'))//品牌详情页
const Login = loadable(() => import('./pages/login'))//品牌详情页
const Index = loadable(() => import('./shouye/index'))//品牌详情页


function Routerview() {
  return (
    <Router>
    <Nav/>
      <Switch > 
        <Route path="/aboutUs" component={aboutUs}></Route>
        <Route path="/navigation" component={navigation}></Route>
        <Route path="/detail" component={detail}></Route>
        <Route path="/info/:infoid" component={InfoDetail}></Route>
        <Route path="/info" component={Info}></Route>
        <Route path="/collections" component={Collections}></Route>
        <Route path="/collectionsdetail/:typename" component={CollectionsDetail}></Route>
        <Route path="/collectionsinfo" component={CollectionsInfo}></Route>
        <Route path="/login" component={Login}></Route>
        <Route path="/user"  component={User}></Route>

        <Route path="/" component={Index}></Route>
      </Switch>
    </Router>
  )
}
export default Routerview